import Vue from 'vue';
import Router from 'vue-router';
Vue.use(Router)

import { BaseRouter } from './router-base'
const createRouter = () => new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({ y: 0 }),
  routes: BaseRouter,
  initRouter: true
})
const router = createRouter()
export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}
export default router